unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, SimCell;

type
  TForm1 = class(TForm)
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    CheckBox4: TCheckBox;
    Edit1: TEdit;
    procedure Edit1Change(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    procedure CheckBox2Click(Sender: TObject);
    procedure CheckBox3Click(Sender: TObject);
    procedure CheckBox4Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;


var
  Form1: TForm1;
  Cell : tCell_Sim;

implementation

{$R *.DFM}

procedure TForm1.Edit1Change(Sender: TObject);
begin
  Cell.setprogram(Edit1.Text);
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
  Cell.setinput(North,TCheckBox(Sender).Checked);
end;

procedure TForm1.CheckBox2Click(Sender: TObject);
begin
  Cell.setinput(West,TCheckBox(Sender).Checked);
end;

procedure TForm1.CheckBox3Click(Sender: TObject);
begin
  Cell.setinput(South,TCheckBox(Sender).Checked);
end;

procedure TForm1.CheckBox4Click(Sender: TObject);
begin
  Cell.setinput(East,TCheckBox(Sender).Checked);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  cell.setflag(north,form1.Checkbox1);
  cell.setflag(west,form1.CheckBox2);
  cell.setflag(south,form1.Checkbox3);
  cell.setflag(east,form1.Checkbox4);
  cell.setprogram(form1.Edit1.Text);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  checkbox1.Color := clBtnFace;
end;

initialization
begin
  cell := tCell_Sim.Create;
end;
end.
